package com.example.demo.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

@RestController
public class HelloController {
    @GetMapping("/hello2")
    public String hello2 (String name)
    {
        System.out.println("hello2: HelloController");
        return "hello springboot! now time is " + LocalDateTime.now().toString()
                + ". name: " + name;
    }

    public HelloController()
    {
        System.out.println("Constructor: HelloController");
    }

    @GetMapping("/hello")
    public String hello1 ()
    {
        return "hello springboot!";
    }
}
